#!/bin/bash


#BIN=`dirname $0`
BIN=/home/jura/yap/yap3
TMP=/home/jura/yap/tmp


for dir_ukolu in $1/$2; do
    if [ -d $dir_ukolu ] ; then   
		id_ukolu=${dir_ukolu##*/}
		
		
		cd $dir_ukolu
		find $dir_ukolu -name '*.tokens' > yap.submissions
	
		for token_studenta in $dir_ukolu/*.tokens; do
			if [ -f $token_studenta ] ; then
				echo $token_studenta > yap.newfiles
				
				$BIN/rkr_gst 2  "sort -n -r +2 -3 yap.summary" 0 0 2>/dev/null
					
			fi
		done
		
	fi
done
